<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<!-- 引入vue.js -->
		<script src="./js/vue.js"></script>
	</head>
	<body>
		<div id="app">			
			<h1>用户名：{{uname}}</h1>						
			<h3>性别：{{sex==1 ? "男" : "女"}}</h3>
			<h3>下单时间：{{new Date(orderTime).toDateString()}}</h3>
			<h3>数量：{{count}}</h3>
			<h3>单价：{{price.toFixed(2)}}</h3>
			<h3>总金额：￥{{total()}}</h3>
		</div>

		<script type="text/javascript">
			var vm = new Vue({
				el: "#app",
				data: {
					uname: "dingding",
					sex: 0,
					orderTime: 1587959581823,
					price: 12.5,
					count: 50,
				},				
				methods:{
					total(){
						return (this.price* this.count).toFixed(2);
					}
				}
			});
		</script>

	</body>
</html>
